<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<header>
<style type='text/css'>


fieldset legend, fieldset button	{
	color: white;
	background: blue;
	border: 1px solid #781351;
	padding: 2px 6px
	} 

fieldset ul, fieldset li	{
	border:0; margin:0; padding:0; list-style:none;
	}
fieldset li	{
	clear:both;
	list-style:none;
	padding-bottom:10px;
	}

fieldset input{
	float:left;
	}
fieldset textarea{
	float:left;
	}
	
fieldset select{
	float:left;
	}

fieldset label{
color:blue;
width:200px;
float:left;
}



</style>
<script type="text/javascript">
//http://woork.blogspot.com/2008/07/useful-tips-to-enrich-your-html-forms.html

function toggleMsg(idElement)
	{
	element = document.getElementById(idElement);
	if(element==null) return;
	if(element.style.visibility!='hidden')
		{
		element.style.visibility='hidden';
		}
	else 
		{
		element.style.visibility='visible';
		}
	}
</script>

<title>${param.pagetitle}</title>
</header>
<body><div><nobr><img src="${pageContext.request.contextPath}/public/img/logo-web2.png"/></nobr></div>


<div style="position:absolute; width:190px;top:20px;right:20px;border:1px solid black;background-color:#eee;padding:10px;z-index:1;">

<c:choose>

	<c:when test="${empty user or not user.identified}">
		<form method="post" ><input type="hidden" name="action" value="login"/>
			<label for="login.login">Login:</label><input type="text" name="login" id="login.login" />
			<label for="login.password">Password:</label><input type="password" name="password" id="login.password" />
		</form>
	</c:when>

	<c:otherwise>
	Connected as <b>${user.login}</b> <c:url var="url" value="${pageContext.request.contextPath}">
	  <c:param name="action" value="logout" />
	</c:url><a href="${fn:escapeXml(url)}">logout</a><br/>
	<c:url var="url" value="${pageContext.request.contextPath}">
	  <c:param name="action" value="project.create" />
	</c:url><a href="${fn:escapeXml(url)}">New Project</a><br/>
	<c:url var="url" value="${pageContext.request.contextPath}">
	  <c:param name="action" value="dataset.create" />
	</c:url><a href="${fn:escapeXml(url)}">New Data Set</a><br/>
	<hr/>
	<c:url var="url" value="${pageContext.request.contextPath}">
	  <c:param name="action" value="projects" />
	</c:url><a href="${fn:escapeXml(url)}">Projects</a>
<c:url var="url" value="${pageContext.request.contextPath}">
	  <c:param name="action" value="datasets" />
	</c:url><a href="${fn:escapeXml(url)}">Data Set</a>
	</c:otherwise>

</c:choose>

</div>

<c:if test="${not empty requestScope['message.text']}"><div>${requestScope['message.text']}</div></c:if>
